package com.ruoyi.pv.service.impl;

import java.util.List;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pv.mapper.PvNoticeMapper;
import com.ruoyi.pv.domain.PvNotice;
import com.ruoyi.pv.service.IPvNoticeService;

/**
 * 通知公告Service业务层处理
 *
 * @author zzx
 * @date 2023-04-11
 */
@Service
public class PvNoticeServiceImpl implements IPvNoticeService {
    private static final Log log = LogFactory.get(PvNoticeServiceImpl.class);

    @Autowired
    private PvNoticeMapper pvNoticeMapper;

    /**
     * 查询通知公告
     *
     * @param id 通知公告主键
     * @return 通知公告
     */
    @Override
    public PvNotice selectPvNoticeById(Long id) {
        return pvNoticeMapper.selectPvNoticeById(id);
    }

    /**
     * 查询通知公告列表
     *
     * @param pvNotice 通知公告
     * @return 通知公告
     */
    @Override
    public List<PvNotice> selectPvNoticeList(PvNotice pvNotice) {
        return pvNoticeMapper.selectPvNoticeList(pvNotice);
    }

    /**
     * 新增通知公告
     *
     * @param pvNotice 通知公告
     * @return 结果
     */
    @Override
    public int insertPvNotice(PvNotice pvNotice) {
        pvNotice.setCreateTime(DateUtils.getNowDate());
        return pvNoticeMapper.insertPvNotice(pvNotice);
    }

    /**
     * 修改通知公告
     *
     * @param pvNotice 通知公告
     * @return 结果
     */
    @Override
    public int updatePvNotice(PvNotice pvNotice) {
        return pvNoticeMapper.updatePvNotice(pvNotice);
    }

    /**
     * 批量删除通知公告
     *
     * @param ids 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deletePvNoticeByIds(Long[] ids) {
        return pvNoticeMapper.deletePvNoticeByIds(ids);
    }

    /**
     * 删除通知公告信息
     *
     * @param id 通知公告主键
     * @return 结果
     */
    @Override
    public int deletePvNoticeById(Long id) {
        return pvNoticeMapper.deletePvNoticeById(id);
    }

    @Override
    public List<PvNotice> selectPvNoticeAppletList(PvNotice pvNotice) {
        return pvNoticeMapper.selectPvNoticeAppletList(pvNotice);
    }

    /**
     * TODO 短信推送
     */
    @Override
    public void sendPvNoticeSms() {
        log.info("任务调度:短信推送开始......");
        //获取到当前五分钟内有

    }
}












